package com.czxy.demo19;

public class BankCard {
    private double balance;

    public void drawMoney(double money) throws BankException {
        if (money > balance) {
            throw new BankException("大哥没有那么多钱，咱们就别装了");
        }
        balance = balance - money;
    }

    public double saveMoney(double money) throws BankException {
        if (money > 5000) {
            throw new BankException("大哥能不能少存点，这一下我算不过来");
        }
        balance = balance + money;

        return balance;
    }
}